home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
CUGUK
/
C005.ZIP
/
MATRIX
/
MAT.H
< prev
next >
Wrap
Text File
|
1990-01-19
|
594b
|
24 lines
struct matrix {
int m_rows, m_cols;
};
struct m_ {
int m_rows, m_cols;
double m_value[1];
};
double m_cofactor(), m_determinant();
struct matrix *m_copy(), *m_invert(), *m_transpose(), *m_multiply(), *m_solve();
#define m_v(m, r, c) ((struct m_ *)m)->m_value[r * (m->m_cols) + c]
#define M_NULL ((struct matrix *)0)
#define m_create(m, r, c) {\
if (((int)(m = (struct matrix *)malloc(sizeof(struct matrix) + (sizeof(double) * r * c)))) == 0) {\
printf("Allocation error: %s\n", __FILE__);\
exit(1);\
}\
m->m_rows = r;\
m->m_cols = c;\
}